package com.dems.dao.dataobject;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Collections;
import java.util.Date;
import java.util.List;

@Data
@TableName("t_usr_user")
public class User {
    private String userId;

    private String phoneNo;

    private String nickname;

    private String password;

    private String passwordSalt;

    private String openId;

    private String unionId;

    private Integer status;

    private String userType;

    @TableField(exist = false)
    private List<String> roleCodeList;

    @TableField(exist = false)
    private List<String> menuCodeList;

    @TableField(exist = false)
    private String sipAccount;

    @TableField(exist = false)
    private String number;

    private String inviteCode;

    private String parentInviteCode;

    private String partnerCode;

    private String name;

    private String email;

    private String headimgUrl;

    private String country;

    private String province;

    private String city;

    private String sex;

    private Date createTime;

    private Date updateTime;

    @TableField(exist = false)
    private String vcode;

    @TableField(exist = false)
    private String inviteName;

    private String profile;

    @TableField(exist = false)
    private String l1UserId;

    @TableField(exist = false)
    private String l1UserName;

    @TableField(exist = false)
    private String l1UserOpenId;

    @TableField(exist = false)
    private Integer allocationAmount;

    @TableField(exist = false)
    private Long gid;

    /**
     * 个人介绍
     * */
    private String personIntroduction;

    /**
     * 工作base地
     */
    private String workCity;

    /**
     * 租户Id
     */
    private Integer buId;

    /**
     * 所属门店ID
     * */
    private String companyId;

    /**
     * 所属门店
     * */
    private String companyName;

    /**
     * 征信账号ID
     * */
    private String creditAccount;

    /**
     * 所属部门ID
     * */
    @TableField(exist = false)
    private Long deptId;

    /**
     * 所属部门名称
     * */
    @TableField(exist = false)
    private String deptName;

    /**
     * 构造系统用户
     * @return
     */
    public static User buildSysUser() {
        User user = new User();
        user.setUserId("0");
        user.setOpenId("0");
        user.setUserType("SYSTEM");
        user.setName("系统");
        user.setRoleCodeList(Collections.singletonList("SYSTEM"));
        return user;
    }
}